package it.disim.tlp.webreputation.aggregatorplugin;

import it.disim.tlp.webreputation.exceptions.QuotaExceededException;

import java.io.IOException;
import java.util.Date;
import java.util.List;

public class Test {

	/**
	 * @param args
	 * @throws IllegalAccessException 
	 * @throws InstantiationException 
	 * @throws ClassNotFoundException 
	 * @throws IOException 
	 */
	public static void main(String[] args) throws ClassNotFoundException, InstantiationException, IllegalAccessException, IOException {
		PluginLoader jl = new PluginLoader("muPlugin","myPlugin.jar",null,"it.disim.tlp.webreputation.myplugin.SimplePlugin");
		AggregatorPlugin sp = jl.getPlugin();
		List<AggregatorPost> splist = null;
		try {
			splist = sp.getPosts("test", new Date());
		} catch (QuotaExceededException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		AggregatorPost mysp = splist.get(0);
		System.out.println(mysp.getAuthor());
		jl.closePlugin();
		
		String libs[] = {"restfb.jar"};
		jl = new PluginLoader("muPlugin","myPlugin.jar",libs,"it.disim.tlp.webreputation.myplugin.AdvancedPlugin");
		sp = jl.getPlugin();
		try {
			sp.getPosts("test", new Date());
		} catch (QuotaExceededException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		mysp = splist.get(0);
		System.out.println(mysp.getAuthor());
		jl.closePlugin();
	}

}
